<!DOCTYPE HTML>
<html>

	<body>
		<div id="result"></div>

		<script type="text/javascript">
            //判断浏览器是否支持
            if(typeof(Storage) != 'undefined'){
                //Store 支持，存储值
                localStorage.setItem('lastname','Gates');
                //Retrieve  取值
                document.getElementById('result').innerHTML = localStorage.getItem('lastname');
                
            }else{
            	document.getElementById('result').innerHTML = '抱歉，您的浏览器不支持 Wed Storage';
            }
		</script>

	</body>
</html>